package org.jeecg.modules.yc.NB.util;

import com.alibaba.fastjson.JSONObject;
import com.ctg.ag.sdk.biz.aep_device_management.CreateDeviceResponse;
import org.jeecg.modules.yc.NB.Services.NBCommandService;

import java.nio.charset.StandardCharsets;

public class NBCommandUtil {
    private final  static int productId = NBCommandService.productId;


    public static byte[] updateDevice(String deviceName,String operator,int autoObserver){
        JSONObject other = new JSONObject();
        other.put("autoObserver",autoObserver);
        JSONObject body = new JSONObject();
        body.put("deviceName",deviceName);
        body.put("operator",operator);
        body.put("other",other);
        body.put("productId",productId);
        return body.toJSONString().getBytes(StandardCharsets.UTF_8);
    }

    public static byte[] createDevice(String deviceName,String operator,int autoObserver,String imei){
        JSONObject other = new JSONObject();
        other.put("autoObserver",autoObserver);
        JSONObject body = new JSONObject();
        body.put("deviceName",deviceName);
        body.put("imei",imei);
        body.put("operator",operator);
        body.put("other",other);
        body.put("productId",productId);
        return body.toJSONString().getBytes(StandardCharsets.UTF_8);
    }
}